﻿@model WarOfDev.Web.ViewModels.RoleViewModel
@{
    ViewBag.Title = "Edit";
}
<h2>
    Edit</h2>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Role</legend>
        @Html.HiddenFor(model => model.Id)
        <div class="editor-label">
            @Html.LabelFor(model => model.GroupId)
        </div>
        <div class="editor-field">
            @Html.Action("GetAllGroups", new { id = Model.GroupId })
            @Html.ValidationMessageFor(model => model.GroupId)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.RoleName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.RoleName)
            @Html.ValidationMessageFor(model => model.RoleName)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.IsLocked)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IsLocked)
            @Html.ValidationMessageFor(model => model.IsLocked)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Permissions)
        </div>
        <div class="editor-field">
            @Html.Action("GetAllPermissions", "Role", new { selectedPermissions = Model.Permissions })
        </div>
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
